package net.mcreator.wastedworld.procedures;

import net.minecraftforge.items.ItemHandlerHelper;

import net.minecraft.item.ItemStack;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.Entity;

import net.mcreator.wastedworld.item.SharpPickaxeHeadItem;
import net.mcreator.wastedworld.WastedWorldMod;

import java.util.Map;

public class CeramicPickaxeDangFangKuaiBeiGongJuPoPiProcedure {
	public static void executeProcedure(Map<String, Object> dependencies) {
		if (dependencies.get("entity") == null) {
			if (!dependencies.containsKey("entity"))
				WastedWorldMod.LOGGER.warn("Failed to load dependency entity for procedure CeramicPickaxeDangFangKuaiBeiGongJuPoPi!");
			return;
		}
		if (dependencies.get("itemstack") == null) {
			if (!dependencies.containsKey("itemstack"))
				WastedWorldMod.LOGGER.warn("Failed to load dependency itemstack for procedure CeramicPickaxeDangFangKuaiBeiGongJuPoPi!");
			return;
		}
		Entity entity = (Entity) dependencies.get("entity");
		ItemStack itemstack = (ItemStack) dependencies.get("itemstack");
		if (((((itemstack)).getDamage()) > (((itemstack)).getMaxDamage()))) {
			if (entity instanceof PlayerEntity) {
				ItemStack _setstack = new ItemStack(SharpPickaxeHeadItem.block);
				_setstack.setCount((int) 1);
				ItemHandlerHelper.giveItemToPlayer(((PlayerEntity) entity), _setstack);
			}
		}
	}
}
